<template>
  <div id="app">
    <!--子传父调用用方法1-->
<!--    <Mycontent :Mytitle="msg" :btnfn="Fcfn"></Mycontent>-->
    <!--子传父调用用方法2，父类接收子类的事件发射-->
<!--    <Mycontent :Mytitle="msg" @newName="msg=$event"></Mycontent>-->
    <div class="container">

      <form class="form-signin">
        <h2 class="form-signin-heading">Please sign in</h2>
<!--        <label for="inputEmail" class="sr-only">Email address</label>-->
        <input type="text" v-model.trim="mail" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
        {{mail}}
<!--        <label for="inputPassword" class="sr-only">Password</label>-->
        <input type="password" v-model="password" id="inputPassword" class="form-control" placeholder="Password" required>
        {{password}}
        <div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> Remember me
          </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
        <button class="btn btn-lg btn-primary btn-block"  @click="reg">Registe</button>
      </form>

    </div> <!-- /container -->
  </div>
</template>

<script>



export default {
  name: 'App',
  data(){
    //传参
    return {
      //msg:'hello vue!'
      mail: '',
      password: '',
    }
  },
  components:{

  },
  methods:{
    Fcfn:function (m) {
    this.msg=m;
  },
    reg(){
      alert("函数执行"+this.mail)
      this.axios({
        method: "get",
        url: 'http://localhost:8090/addUser?mail='+this.mail+"&password="+this.password
      }).then(function (response) {
        alert(response.data)
      console.log(response.data)
      }).catch((response)=>{
        console.log(response);
      })
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
